package com.xuchaotong.service.impl;

import com.xuchaotong.dao.BookMapper;
import com.xuchaotong.entity.Book;
import com.xuchaotong.service.BookService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component
public class BookServiceImpl implements BookService{
    private static final Logger LOG = LoggerFactory.getLogger(BookServiceImpl.class);

    @Autowired
    private BookMapper bookMapper;

    @Override
    public void saveBook(Book book){
        LOG.info("我是LOG");
        bookMapper.insert(book);
    }

    @Override
    public Book getBookById(Integer id) {
        return bookMapper.selectByPrimaryKey(id);
    }
}
